<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8" />
    <title>房贷计算器</title>
    <style>
      /* 样式表 */
      body {
        font-family: Arial, Helvetica, sans-serif;
        margin: 0;
        padding: 0;
      }

      .container {
        max-width: 600px;
        margin: 0 auto;
        padding: 20px;
        background-color: #f5f5f5;
        border-radius: 10px;
      }

      h1 {
        text-align: center;
        margin-top: 0;
      }

      label {
        display: block;
        margin-bottom: 10px;
      }

      input[type='number'] {
        width: 100%;
        padding: 10px;
        border: none;
        border-radius: 5px;
        margin-bottom: 20px;
        box-sizing: border-box;
        font-size: 16px;
      }

      input[type='submit'] {
        background-color: #4caf50;
        color: #fff;
        border: none;
        padding: 10px 20px;
        border-radius: 5px;
        cursor: pointer;
        font-size: 16px;
      }

      input[type='submit']:hover {
        background-color: #3e8e41;
      }

      #result {
        margin-top: 20px;
        font-size: 24px;
        text-align: center;
      }
    </style>
  </head>
  <body>
    <div class="container">
      <h1>房贷计算器</h1>
      <form>
        <label>房屋面积（平米）：</label>
        <input type="number" id="area" />

        <label>房屋单价（元/平米）：</label>
        <input type="number" id="price" />

        <label>按揭成数：</label>
        <input type="number" id="ratio" />

        <label>贷款年限（年）：</label>
        <input type="number" id="years" />

        <input type="submit" value="计算" />
      </form>

      <div id="result">
        <p>房屋总价：元</p>
        <p>首付款：元</p>
        <p>贷款金额：元</p>
        <p>贷款年限：年</p>
        <p>贷款月数：个月</p>
        <p>月供：元/月</p>
      </div>
    </div>

    <script src="script.js"></script>
  </body>
</html>
